#!/usr/bin/perl 
#===============================================================================
#
#         FILE:  tt.pl
#
#        USAGE:  ./tt.pl 
#
#  DESCRIPTION:  
#
#      OPTIONS:  ---
# REQUIREMENTS:  ---
#         BUGS:  ---
#        NOTES:  ---
#       AUTHOR:   (), <>
#      COMPANY:  
#      VERSION:  1.0
#      CREATED:  2008-8-14 23:04:43 中国标准时间
#     REVISION:  ---
#===============================================================================

use strict;
use warnings;

use Parse;
use encoding 'UTF-8', STDIN =>'UTF-8', STDOUT =>'UTF-8';

open FH, '<:encoding(utf-8)', '../dollar.js';
my @jscode = <FH>;
close FH;

my $js_parse = new Parse("javascript", join('', @jscode));
open STDOUT, '>:encoding(utf-8)', 'dollar.html';

print <<HTML_START;
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>JSCODE</title>
<style>
li{border-bottom:1px dashed #ccc;line-height:25px}
li b{font-weight:normal}
HTML_START

for my $keytype (keys %{$IdItem::Colors}) {
    print '.c' . $keytype . '{color:' . $IdItem::Colors->{$keytype} . '}';
}

print <<HTML_START;
</style>
</head>
<body>
HTML_START

print $js_parse->to_html();

print <<HTML_END;
</body>
</html>
HTML_END
close STDOUT;
